import React, { Component } from "react";

export default class App extends Component {
  state = {
    todoList: ["吃饭"],
  };
  render() {
    let title = null;
    if (this.state.todoList.length === 0) {
      title = <p>您当前暂无待办事项</p>;
    } else {
      title = <div>您当前有{this.state.todoList.length}条代办事项</div>;
    }
    return <div>{title}</div>;
  }
}
